About the Standard File Package and System 7.0
standard user interface for naming and identifying files. The
names and locations of files to be saved or opened, and it reports the user's choices to
your application. The new procedures introduced in system 7.0 allow your application
more control over the user interface.
, to determine whether the new features are present.
To use the information in this section you must be familiar with earlier versions of
File Manager, and the new features of the system 7.0 Finder, described in the application when the user saves or opens a document. It displays dialog boxes through
which the user specifies the name and location of the document to be saved or opened. It
allows your application to customize the dialog boxes and, through callback routines,
describe the user's choices through a reply record.
• a pair of simplified procedures that you call to display and handle the
standard Open and Save dialog boxes • a pair of customizable procedures that you call when you need more
control over the interaction
folders with a file system specification record and that accommodates
the new Finder features
• a new layout for the default dialog boxes
after the user chooses Save, Save As, or Open from the File menu. When saving a document, you call one of the PutFile procedures; when opening a
document, you call one of the GetFile procedures. The revised
standard interface
interface
are available by calling the Gestalt function with a selector of gestaltStandardFileAttr. If Gestalt sets the gestaltStandardFile58 bit in the reply, the four new procedures are available. For a complete description of the Gestalt function, All the new procedures return the results of the dialog boxes in a new reply record,
The reply record identifies selected files with a file system specification (FSSpec ) functions provided with system 7.0. The reply record also contains additional fields
that support the Finder features introduced in system 7.0.
The sfGood field reports whether the reply record is valid. The value is TRUE after the user clicks Save or Open, FALSE after the user clicks Cancel. When the user has completed the dialog box, the other fields in the reply record are valid only if sfGood is
TRUE.
The sfReplacing field reports whether a file to be saved replaces an existing file of the CustomPutFile procedure. When the user assigns a name that duplicates that of an the sfReplacing field to TRUE and returns to your application; if the user cancels the
If the chosen name does not conflict with a name that already exists, the
rely on the value of this field instead of checking for and handling name conflicts itself.
The sfType field contains the file type of the selected file. (File types are described in type in this field.
The sfFile field describes the selected file, folder, or volume with a file system specification record, which contains a volume reference number, parent directory ID,
and name. (See the File Manager for a complete description of the file system specification record.) If the selected item is an alias for another item, the
record for the target in the sfFile field when the user completes the dialog. If the
selected file is a stationery pad, the reply record describes the file itself, not a copy of
the file.
The sfScript field identifies the script in which the name of the document is to be displayed. (This information is used by the Finder and by the
Worldwide Software Overview for a list of defined script codes.) A script code of
smSystemScript (-1) represents the default system script.
The sfFlags field contains the Finder flags from the Finder information record in the catalog entry for the selected file. (See the section en titled Finder Interface for a description of the Finder flags.) This field is returned only by StandardGetFile and CustomGetFile. If your application supports stationery, it should check the stationery bit in the Finder flags to determine whether to treat the selected file as
create a document from a stationery pad and pass your application the new document. If
the user opens a stationery document from within an application that does not support
the master copy is being opened.
The sfIsFolder field reports whether the selected item is a folder (TRUE) or a file or volume (FALSE).
The sfIsVolume field reports whether the selected item is a volume (TRUE) or a file or folder (FALSE).